<template>
  <basic-container class="noScrollBar tabMain-wrap">
    <common-template
        ref="detailRef"
        :detailOptions="detailOptions"
        :flowStatus="flowStatus"
        :flowModelId="flowModelId"
        :filePrint="filePrint"
    ></common-template>
  </basic-container>
</template>
<script>
import commonTemplate from "../commonTemplate";
import {
    dnzlFlowModelId,
    getDnzlViewList,
    dnzlPrint,
} from "@/api/sxdky/sxdky";
export default {
  data() {
    return {
      // 流程模型
      flowModelId:dnzlFlowModelId,
      // 流程按钮状态
      flowStatus:false,
      // 文件打印
      filePrint:dnzlPrint,
      detailOptions: {
        label: "电能报告查询",
        name: "reportViewList",
        options: {
          height: "calc(100vh - 425px)",
          addBtn: false,
          menuDelBtn: false,
          menuUpBtn: false,
          menuDownBtn: true,
          dialogDirection: "ltr",
          dialogType: "drawer",
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          indexLabel: "序号",
          viewBtn: false,
          selection: true,
          excelBtn: false,
          dialogClickModal: false,
          // 自定义操作按钮，下载上传
          menuOtherBtn: true,
          gistBtn: false,
          align: "center",
          menuAlign: "center",
          searchIcon: true,
          searchIndex: 3,
          labelWidth: 120,
          editBtn: false,
          delBtn: false,
          printBtn: false,
          column: [
              {
                  label: "检测报告",
                  prop: 'reportUploadName',
                  type: "upload",
                  showFileList: true,
                  loadText: "模板上传中，请稍等",
                  span: 24,
                  propsHttp: {
                      res: "data.data.object",
                  },
                  slot:true,
                  accept: ".docx,.doc,",
                  tip: "请上传 .doc,.docx 标准格式文件",
                  action: '/api/dis-report/dnzl/upload',
              },
              {
                  label: "报告名称",
                  prop: "reportUploadName",
                  editDisplay: false,
                  hide:true,
                  viewDisplay: false,
                  overHidden: true,
                  search: false,
                  addDisplay:false,
                  rules: [
                      {
                          message: "请输入报告名称",
                          trigger: "click",
                      },
                  ],
              },

              {
                  label: "付款凭证",
                  prop: 'payProof',
                  type: "upload",
                  showFileList: true,
                  loadText: "模板上传中，请稍等",
                  span: 8,
                  propsHttp: {
                      res:"data.data"
                  },
                  slot:true,
                  accept: ".png,.pdf,.jpeg",
                  tip: "请上传 .png,.jpeg,.pdf标准格式文件",
                  action: '/api/dis-report/dnzl/payProofUpload?groupId=dnzl',
              },

              {
                  label: '付款凭证',
                  prop: 'payProof',
                  type: 'upload',
                  hide:true,
                  row: false,
                  loadText: '附件上传中，请稍等',
                  listType: "picture-img",
                  limit: 1,
                  propsHttp: {
                      res: 'data',
                  },
                  canvasOption: {
                      text: 'avue',
                      ratio: 0.1
                  },
                  action: "/api/sis-file/file/localUpload",
                  rules: [
                      {
                          // required: true,
                          message: "请选择上传的附件",
                          trigger: "blur"
                      }
                  ],
              },
              {
                  label: "报告编号",
                  prop: "reportNum",
                  editDisplay: true,
                  viewDisplay: true,
                  overHidden: true,
                  search: true,
                  rules: [
                      {
                          required: true,
                          message: "请输入报告编号",
                          trigger: "click",
                      },
                  ],
              },
              {
                  label: "器具名称",
                  prop: "applianceName",
                  search: true,
                  editDisplay: true,
                  viewDisplay: true,
                  overHidden: true,
                  rules: [
                      {
                          required: true,
                          message: "请输入器具名称",
                          trigger: "click",
                      },
                  ],
              },
              {
                  label: "型号/规格",
                  prop: "type",
                  search: true,
                  editDisplay: true,
                  viewDisplay: true,
                  rules: [
                      {
                          required: true,
                          message: "请输入型号/规格",
                          trigger: "click",
                      },
                  ],
              },
              {
                  label: "制造单位",
                  prop: "proDept",
                  search: true,
                  editDisplay: true,
                  viewDisplay: true,
                  overHidden: true,
                  rules: [
                      {
                          required: true,
                          message: "请输入制造单位",
                          trigger: "click",
                      },
                  ],
              },
              {
                  label: "委托单位",
                  prop: "entDept",
                  search: true,
                  editDisplay: true,
                  viewDisplay: true,
                  overHidden: true,
                  rules: [
                      {
                          required: true,
                          message: "请输入委托单位",
                          trigger: "click",
                      },
                  ],
              },
              {
                  label: "出厂编号",
                  prop: "serialNum",
                  search: true,
                  editDisplay: true,
                  viewDisplay: true,
                  overHidden: true,
                  rules: [
                      {
                          required: true,
                          message: "请输入出厂编号",
                          trigger: "click",
                      },
                  ],
              },
              {
                  label: "检测日期",
                  prop: "checkDate",
                  sortable: true,
                  editDisplay: true,
                  viewDisplay: true,
                  overHidden: true,
                  rules: [
                      {
                          message: "请输入检测日期",
                          trigger: "click",
                      },
                  ],
              },
              {
                  label: "提交人",
                  prop: "submitName",
                  search: true,
                  addDisplay:false,
                  editDisplay: false,
                  viewDisplay: false,
                  overHidden: true,
              },
            {
              label: "提交日期",
              prop: "submitTime",
              type: "date",
              sortable: true,
              editDisplay: true,
              viewDisplay: true,
              overHidden: true,
              format: "yyyy-MM-dd hh:mm:ss",
              valueFormat: "yyyy-MM-dd hh:mm:ss",
              rules: [
                {
                  required: true,
                  message: "请输入提交时间",
                  trigger: "click",
                },
              ],
            },
            {
                label: "处理状态",
                prop: "submitStatus",
                type: "select",
                search: false,
                addDisplay:false,
                editDisplay: false,
                viewDisplay: false,
                rules: [
                    {
                        required: true,
                        message: "请选择处理状态",
                        trigger: "click",
                    },
                ],
                dicData: [
                    {
                        label: "新建",
                        value: 0,
                    },
                    {
                        label: "审核中",
                        value: 1,
                    },
                    {
                        label: "已审核",
                        value: 2,
                    },
                    {
                        label: "已退件",
                        value: 3,
                    },
                ],
            },
          ],
        },
        url: {
          getList: getDnzlViewList,
          print:dnzlPrint
        },
      },
    };
  },
  components: {
      commonTemplate,
  },
  computed: {},
  created() {},
  methods: {},
};
</script>

<style lang='scss'>
.tabMain-wrap {
  // height: calc(100vh - 400px);
  overflow: hidden auto;
}
</style>
